package com.cn.mmd.service;

import com.cn.mmd.mapper.ActivityMapper;
import com.cn.mmd.mapper.StudentActivityMapper;
import com.cn.mmd.model.Activity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by Administrator on 2016/7/27 0027.
 */
@Service("manageActivityService")
public class ManageActivityServiceImpl implements  ManageActivityService {

    @Autowired
    private ActivityMapper activityMapper;

    @Autowired
    private StudentActivityMapper studentActivityMapper;

    @Override
    public int insertSelective(Activity record) {
        return activityMapper.insertSelective(record);
    }

    @Override
    public Activity selectByAll(Activity activity) {
        return activityMapper.selectByAll(activity);
    }

    @Override
    public int updateByPrimaryKeySelective(Activity record) {
        return activityMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int deleteByPrimaryKey(Integer activityid) {
        return activityMapper.deleteByPrimaryKey(activityid);
    }

    @Override
    public int deleteByActId(Integer activityId) {
        return studentActivityMapper.deleteByActId(activityId);
    }

    @Override
    public int countLimitNum(Activity activity) {
        return activityMapper.countLimitNum(activity);
    }
}
